package com.sicheng.metadata.se;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * @author zsc
 * @version 1.0
 * @date 2021/12/17 14:06
 */
public class Java {
    public static void main(String[] args) {
        BusinessType other1 = BusinessType.valueOf("OTHER");
        System.out.println(other1);
        BusinessType other2 = BusinessType.valueOf("OTHER");
        System.out.println(other2);
        System.out.println(other1==other2);


        System.out.println(BusinessType.OTHER.name());

        BigDecimal decimal1 = BigDecimal.valueOf(1.0 / 3);
        BigDecimal decimal2 = BigDecimal.valueOf(1.0 / 3);

        System.out.println((decimal1.add(decimal2).setScale(2, RoundingMode.HALF_UP)));
        System.out.println((decimal1.add(decimal2).setScale(2, BigDecimal.ROUND_HALF_UP)));
    }
}
